package cn.fintecher.gis.entity;


import cn.fintecher.gis.enums.CommonState;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Set;

@Data
@Table(name = "role_info")
@Entity
@ApiModel(value = "roleInfo", description = "角色管理")
public class RoleInfo extends BaseEntity {

    @ApiModelProperty("角色名称")
    private String roleName;

    @ApiModelProperty("角色状态 1 启用  2.停用")
    @Enumerated(EnumType.STRING)
    private CommonState roleStatus;

    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name = "role_resource", joinColumns = @JoinColumn(name = "role_id"), inverseJoinColumns = @JoinColumn(name = "reso_id"))
    private Set<Resource> resources;
}
